{include file="common/header"}
<div id="app" v-cloak>
    <div class="el-pane-warp">
		<el-form ref="config" :model="config" label-width="100px">
			<el-form-item>
				<template slot="label">
					<div><el-tooltip placement="top" content="{literal}{$system.company}{/literal}"><div>公司名称：</div></el-tooltip></div>
				</template>
				<el-input v-model="config.company"></el-input>
			</el-form-item>
			<el-form-item>
				<template slot="label">
					<div><el-tooltip placement="top" content="{literal}{$system.email}{/literal}"><div>公司邮箱：</div></el-tooltip></div>
				</template>
				<el-input v-model="config.email"></el-input>
			</el-form-item>
			<el-form-item>
				<template slot="label">
					<div><el-tooltip placement="top" content="{literal}{$system.telephone}{/literal}"><div>公司电话：</div></el-tooltip></div>
				</template>
				<el-input v-model="config.telephone"></el-input>
			</el-form-item>
			<el-form-item>
				<template slot="label">
					<div><el-tooltip placement="top" content="{literal}{$system.phone}{/literal}"><div>手机号码：</div></el-tooltip></div>
				</template>
				<el-input v-model="config.phone"></el-input>
			</el-form-item>
			<el-form-item>
				<template slot="label">
					<div><el-tooltip placement="top" content="{literal}{$system.fax}{/literal}"><div>公司传真：</div></el-tooltip></div>
				</template>
				<el-input v-model="config.fax"></el-input>
			</el-form-item>
			<el-form-item>
				<template slot="label">
					<div><el-tooltip placement="top" content="{literal}{$system.address}{/literal}"><div>公司地址：</div></el-tooltip></div>
				</template>
				<el-input v-model="config.address"></el-input>
			</el-form-item>
			<el-form-item>
				<template slot="label">
					<div><el-tooltip placement="top" content="{literal}{$system.business_hours}{/literal}"><div>营业时间：</div></el-tooltip></div>
				</template>
				<el-input v-model="config.business_hours"></el-input>
			</el-form-item>
			<el-form-item>
				<template slot="label">
					<div><el-tooltip placement="top" content="{literal}{$system.wechat}{/literal}"><div>网站微信号：</div></el-tooltip></div>
				</template>
				<el-input v-model="config.wechat"></el-input>
			</el-form-item>
			<el-form-item>
				<template slot="label">
					<div><el-tooltip placement="top" content="{literal}{$system.qq}{/literal}"><div>网站QQ号：</div></el-tooltip></div>
				</template>
				<el-input v-model="config.qq"></el-input>
			</el-form-item>
			<el-form-item>
				<template slot="label">
					<div><el-tooltip placement="top" content="{literal}{$system.ico}{/literal}"><div>地址栏ico：</div></el-tooltip></div>
				</template>
				<el-file-upload v-model="config.ico" type=".ico"></el-file-upload>
			</el-form-item>
			<el-form-item>
				<template slot="label">
					<div><el-tooltip placement="top" content="{literal}{$system.logo}{/literal}"><div>网站Logo：</div></el-tooltip></div>
				</template>
				<el-file-upload v-model="config.logo" type=".png,.jpg,.jpeg"></el-file-upload>
			</el-form-item>
			<el-form-item>
				<template slot="label">
					<div><el-tooltip placement="top" content="{literal}{$system.copy_logo}{/literal}"><div>网站副Logo：</div></el-tooltip></div>
				</template>
				<el-file-upload v-model="config.copy_logo" type=".png,.jpg,.jpeg"></el-file-upload>
			</el-form-item>
			<el-form-item>
				<template slot="label">
					<div><el-tooltip placement="top" content="{literal}{$system.wechat_qrcode}{/literal}"><div>公众号：</div></el-tooltip></div>
				</template>
				<el-file-upload v-model="config.wechat_qrcode" type=".png,.jpg,.jpeg"></el-file-upload>
			</el-form-item>
			<el-form-item>
				<template slot="label">
					<div><el-tooltip placement="top" content="{literal}{$system.seo_title}{/literal}"><div>网站标题：</div></el-tooltip></div>
				</template>
				<el-input v-model="config.seo_title"></el-input>
			</el-form-item>
			<el-form-item>
				<template slot="label">
					<div><el-tooltip placement="top" content="{literal}{$system.seo_keywords}{/literal}"><div>网站关键词：</div></el-tooltip></div>
				</template>
				<el-input v-model="config.seo_keywords" placeholder="关键词请用逗号(,)隔开"></el-input>
			</el-form-item>
			<el-form-item>
				<template slot="label">
					<div><el-tooltip placement="top" content="{literal}{$system.seo_description}{/literal}"><div>网站描述：</div></el-tooltip></div>
				</template>
				<el-input type="textarea" v-model="config.seo_description"></el-input>
			</el-form-item>
			<el-form-item>
				<template slot="label">
					<div><el-tooltip placement="top" content="{literal}{$system.copyright}{/literal}"><div>版权信息：</div></el-tooltip></div>
				</template>
				<el-input v-model="config.copyright"></el-input>
			</el-form-item>
			<el-form-item>
				<template slot="label">
					<div><el-tooltip placement="top" content="{literal}{$system.icp|raw}{/literal}"><div>备案号：</div></el-tooltip></div>
				</template>
				<el-editor v-model="config.icp"></el-editor>
			</el-form-item>
		</el-form>
		<div class="el-bottom">
			<el-button 
				size="medium"
				:loading="loading" 
				type="primary" 
				icon="el-icon-refresh-right" 
				@click="save()">
				保 存
			</el-button>
		</div>
	</div>
</div>
<script>
	new Vue({
	    el: '#app',
	    data() {
	        return {
	            logo: [],
	        	url: "config/system",
	        	config: {:json_encode($config)},
	        	loading: false,
	        }
	    },
	    methods: {
	        /**
             * 保存基础配置
             */
	        save() {
	        	let self = this;
	        	self.loading = true;
	        	request.post(self.url, {config: self.config}, function(res){
                    self.loading = false;
                    self.$notify({showClose: true, message: res.message, type: res.status});
                });
	        },
	    }
	})
</script>
{include file="common/footer"}